<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2022/4/14
 * Time: 14:08
 */

namespace app\api\controller;
use app\common\controller\Api;
use think\Db;
use think\Request;

class TeamBuildingVideo extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function list()
    {
        if (!Request::instance()->isGet())
            $this->error('请求方式不正确');
        if(!$type = input('get.type'))
            $this->error('缺少参数');
        $limit = input('get.limit',10);
        $page = input('get.page',1);
        $list = Db::name('team_building_video')->where('type',$type)->order('id','desc')->field('id,title,type,video,image')->paginate($limit,false,['page'=>$page]);
        if($list)
            $this->success('',$list);
        $this->error('暂无数据');
    }
}